<template>
    <!-- <Scan2 @click="doScan" /> -->
    <view @click="doScan">
     <image  style="width: 40rpx;height: 40rpx;display: block;" src="@/assets/images/homePage/shouye_icon_saoma.png"/>
    </view>
</template>
    
<script setup lang='ts'>
// import { Scan2 } from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';

function doScan() {    
    Taro.scanCode({
        success: (res) => {
            console.log(res);
            Taro.showToast({
                title: '扫描成功',
                icon: 'success',
                duration: 2000
            });
        },
        fail: (res) => {
            console.log(res);
            Taro.showToast({
                title: '扫描失败',
                icon: 'none',
                duration: 2000
            });
        }
    });
}

</script>
    
<style></style>